import java.util.Scanner;
class Person{
	private String name;
	private int age;
	private boolean gender;
	private int id=0;
	public Person(){
		System.out.println("This is constructor");
		System.out.println(name+","+age+","+gender+","+id);
		System.out.println("Person [name="+name+", age="+age+", gender="+gender+", id="+id+"]");
	}
	public Person(String name, int age, boolean gender){
		this.name=name;
		this.age=age;
		this.gender=gender;
	}
	public String toString(){
		System.out.println("Person [name="+this.name+", age="+this.age+", gender="+this.gender+", id="+0+"]");
		return name;
	}
}
public class Main{
	public static void main(String[] args) {
		Scanner reader=new Scanner(System.in);
		int n=reader.nextInt();
		Person[] p=new Person[n];
		for(int i=0; i<p.length; i++) {
			String name=reader.next();
			int age=reader.nextInt();
			boolean genter=reader.nextBoolean();
			p[i]=new Person(name,age,genter);
		}
		for(int x=p.length-1; x>=0;x--){
			p[x].toString();
		}
		p.toString();
		Person p1=new Person();
	}

}
